import React, { Component ,Fragment} from 'react'
import { baseRoutes } from 'routes'
import { Switch, Route, Redirect } from 'react-router-dom'
import Admin from './pages/Admin/index.js'
export default class App extends Component {
	render() {
		return (
			<Fragment>
				<Switch>
					{/* 基础路由 */}
					{
						baseRoutes.map(route=>{
							return (
								<Route 
									key={route.path}
									path={route.path}
									component={route.component}
								/>
							)
						})
					}
					{/* admin主页 */}
					<Route 
						path="/admin"
						component={Admin}
					/>
					<Redirect to="/admin" exact from="/"/>
					<Redirect to="/404"/>
				</Switch>
			</Fragment>
		)
	}
}
